package com.trkj.Sevlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.trkj.liuyan.LiuYanDAO;

/**
 * Servlet implementation class DeleteLiuYanSevlet
 */
@WebServlet("/delete")
public class DeleteLiuYanSevlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private LiuYanDAO liuYanDAO=new LiuYanDAO();
	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		String sort=request.getParameter("sort");
		request.setAttribute("sort", sort);
		
		String id1 = request.getParameter("id");
		int id = Integer.parseInt(id1);
		liuYanDAO.delete(id);
		request.getRequestDispatcher("list").forward(request, response);
	}

}
